#include "StdAfx.h"
#include "SceneNodeMotionState.hpp"

namespace he
{
	SceneNodeMotionState::SceneNodeMotionState(Ogre::SceneNode &SceneNode, btTransform const &InitialPos)
		: m_SceneNode(SceneNode), m_InitialPos(InitialPos)
	{
	}

	void SceneNodeMotionState::getWorldTransform(btTransform &WorldTrans) const
	{
		WorldTrans = m_InitialPos;
	}
	
	void SceneNodeMotionState::setWorldTransform(btTransform const &WorldTrans)
	{
		btQuaternion rotation = WorldTrans.getRotation();
		m_SceneNode.setOrientation(rotation.w(), rotation.x(), rotation.y(), rotation.z());
		btVector3 position = WorldTrans.getOrigin();
		m_SceneNode.setPosition(position.x(), position.y(), position.z());

	}
} /*he*/
